<?php
namespace Home\Controller;
use Think\Controller;
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';

class IndexController extends Controller {

    public function __construct()
    {
    	parent::__construct();

    	$Wechat = A('Wechat'); //调用微信控制器
    	//$Wechat->definedItem();//自定义菜单 调用一次创建就行了
    	$user_id = session('user_id');
    	if(empty($user_id))
    	{
    		$Wechat->getWc_user();
    	}
    	
    }


    public function index()
    {

    	$user_id = session('user_id');
		$user_name = session('user_name');

		$this->assign('user_id',$user_id);
		$this->assign('user_name',$user_name);

		$this->display('Index/index');
    }

    public function logout()
	{
		session('user_id',null);
        session('user_name',null);
        
		$this->error('注销登录！',U('Index/index'),3);
	}

	/*echo MODULE_NAME."<br>";
    echo CONTROLLER_NAME."<br>";
    echo ACTION_NAME."<br>";*/

	
}